// ====================================================================
//  Class:  TaskForces.Tab_TaskForcesRules
//  Parent: XInterface.GUITabPanel
//
//  <Enter a description here>
// ====================================================================

class Tab_TaskForcesRules extends Tab_InstantActionBaseRules config(SigGame);

//TF-Stuff
var config  int		LastBounty;
var config	int		LastOutpostDist;
var config	int		LastStartupRes;
var config	int		LastBuildLimit;
var config	bool	LastBuildAreas;
var config  int     LastMinimumIncome;
var config  int     LastSkillAmount;
var config  bool    LastToggleWarhead;
var config  bool    LastFastBuildTime;
var config  bool    LastTerr;
var config  int     LastMaxSentinel;
var config  bool    LastAllowUpgrades;
var config  bool    LastUnlimitedRES;


var moNumericEdit	MyBounty;
var	moNumericEdit	MyOutpostDist;
var	moNumericEdit	MyStartupRes;
var	moNumericEdit	MyBuildLimit;
var moCheckBox		MyBuildAreas;
var moNumericEdit   MyMinimumIncome;
var moNumericEdit   MySkillAmount;
var moCheckBox      MyToggleWarhead;
var moCheckBox      MyFastBuildTime;
var moCheckBox      MyTerr;
var moNumericEdit   MyMaxSentinel;
var moCheckBox      MyAllowUpgrades;
var moCheckBox      MyUnlimitedRES;



function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
//	local int NewGameSpeed;

	Super.Initcomponent(MyController, MyOwner);

    MyMaxLives.bVisible = false;
    MyWeaponStay.bVisible = false;
    MyTranslocator.bVisible = false;
    MyWeaponThrowing.bVisible = false;

    //TF-Stuff
    MyBounty=moNumericEdit(Controls[14]);
    MyOutpostDist=moNumericEdit(Controls[15]);
    MyStartupRes=moNumericEdit(Controls[16]);
    MyBuildLimit=moNumericEdit(Controls[17]);
    MyBuildAreas=moCheckBox(Controls[18]);
	MyMinimumIncome=moNumericEdit(Controls[19]);
	MySkillAmount=moNumericEdit(Controls[20]);
	MyToggleWarhead=moCheckBox(Controls[21]);
	MyFastBuildTime=moCheckBox(Controls[22]);
	MyTerr=moCheckBox(Controls[23]);
	MyMaxSentinel=moNumericEdit(Controls[24]);
	MyAllowUpgrades=moCheckBox(Controls[25]);
	MyUnlimitedRES=moCheckBox(Controls[26]);


    MyBounty.SetValue(LastBounty);
    MyOutpostDist.SetValue(LastOutpostDist);
    MyStartupRes.SetValue(LastStartupRes);
    MyBuildLimit.SetValue(LastBuildLimit);
    MyBuildAreas.Checked(LastBuildAreas);
	MyMinimumIncome.SetValue(LastMinimumIncome);
	MySkillAmount.SetValue(LastSkillAmount);
	MyToggleWarhead.Checked(LastToggleWarhead);
	MyFastBuildTime.Checked(LastFastBuildTime);
	MyTerr.Checked(LastTerr);
	MyMaxSentinel.SetValue(LastMaxSentinel);
	MyAllowUpgrades.Checked(LastAllowUpgrades);
	MyUnlimitedRES.Checked(LastUnlimitedRES);

}

function string Play()
{
    //TF-Stuff
    LastBounty = MyBounty.GetValue();
	LastOutpostDist = MyOutpostDist.GetValue();
	LastStartupRes  = MyStartUpRes.GetValue();
    LastBuildLimit  = MyBuildLimit.GetValue();
    LastBuildAreas = MyBuildAreas.IsChecked();
	LastMinimumIncome = MyMinimumIncome.GetValue();
	LastSkillAmount = MySkillAmount.GetValue();
	LastToggleWarhead = MyToggleWarhead.IsChecked();
	LastFastBuildTime = MyFastBuildTime.IsChecked();
	LastTerr = MyTerr.IsChecked();
	LastMaxSentinel = MyMaxSentinel.GetValue();
	LastAllowUpgrades = MyAllowUpgrades.IsChecked();
	LastUnlimitedRES = MyUnlimitedRES.IsChecked();

	SaveConfig();

	return Super.Play()$"?Bounty="$LastBounty$"?OutpostDist="$LastOutpostDist$"?StartupResources="$LastStartupRes$"?BuildLimit="$LastBuildLimit$"?BuildAreas="$LastBuildAreas;
}

defaultproperties
{
     Begin Object Class=GUIImage Name=IARulesBK1
         Image=Texture'InterfaceContent.Menu.BorderBoxD'
         ImageColor=(A=160)
         ImageStyle=ISTY_Stretched
         WinTop=0.024687
         WinLeft=0.021641
         WinWidth=0.957500
         WinHeight=0.156016
     End Object
     Controls(0)=GUIImage'taskforces.Tab_TaskForcesRules.IARulesBK1'

     Begin Object Class=GUIImage Name=IARulesBK2
         Image=Texture'InterfaceContent.Menu.BorderBoxD'
         ImageColor=(A=160)
         ImageStyle=ISTY_Stretched
         WinTop=0.239531
         WinLeft=0.509922
         WinWidth=0.469219
         WinHeight=0.730606
     End Object
     Controls(1)=GUIImage'taskforces.Tab_TaskForcesRules.IARulesBK2'

     Begin Object Class=GUIImage Name=IARulesBK3
         Image=Texture'InterfaceContent.Menu.BorderBoxD'
         ImageColor=(A=160)
         ImageStyle=ISTY_Stretched
         WinTop=0.239531
         WinLeft=0.019531
         WinWidth=0.469219
         WinHeight=0.730606
     End Object
     Controls(2)=GUIImage'taskforces.Tab_TaskForcesRules.IARulesBK3'

     Begin Object Class=moNumericEdit Name=IARulesTimeLimit
         MaxValue=3600
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Time Limit"
         OnCreateComponent=IARulesTimeLimit.InternalOnCreateComponent
         Hint="The game will end after this many minutes of play."
         WinTop=0.371615
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(10)=moNumericEdit'taskforces.Tab_TaskForcesRules.IARulesTimeLimit'

     Begin Object Class=moCheckBox Name=IARulesAllowWeaponThrow
         ComponentJustification=TXTA_Left
         CaptionWidth=0.900000
         Caption="Allow Weapon Throwing"
         OnCreateComponent=IARulesAllowWeaponThrow.InternalOnCreateComponent
         Hint="When selected, a player will have the ability to throw out his current weapon."
         WinTop=0.315104
         WinLeft=0.050000
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(12)=moCheckBox'taskforces.Tab_TaskForcesRules.IARulesAllowWeaponThrow'

     Begin Object Class=moCheckBox Name=IARulesBrightSkins
         ComponentJustification=TXTA_Left
         CaptionWidth=0.925000
         Caption="Bright Skins"
         OnCreateComponent=IARulesBrightSkins.InternalOnCreateComponent
         Hint="When selected, the server will cause the skins to be brighter than usual."
         WinTop=0.370833
         WinLeft=0.050000
         WinWidth=0.390626
         WinHeight=0.040000
         OnChange=Tab_TaskForcesRules.BrightOnchange
     End Object
     Controls(13)=moCheckBox'taskforces.Tab_TaskForcesRules.IARulesBrightSkins'

     Begin Object Class=moNumericEdit Name=IARulesBounty
         MaxValue=250
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Bounty Amount"
         OnCreateComponent=IARulesBounty.InternalOnCreateComponent
         Hint="The amount of resources players get as reward for frags."
         WinTop=0.428124
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(14)=moNumericEdit'taskforces.Tab_TaskForcesRules.IARulesBounty'

     Begin Object Class=moNumericEdit Name=IARulesOutpostDist
         MaxValue=500
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Outpost Distance"
         OnCreateComponent=IARulesOutpostDist.InternalOnCreateComponent
         Hint="The min. distance (in m) between Outposts and Basecores."
         WinTop=0.484634
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(15)=moNumericEdit'taskforces.Tab_TaskForcesRules.IARulesOutpostDist'

     Begin Object Class=moNumericEdit Name=IARulesStartResources
         MaxValue=3000
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Startup Resources"
         OnCreateComponent=IARulesStartResources.InternalOnCreateComponent
         Hint="Every player starts with this amount of resources."
         WinTop=0.541144
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(16)=moNumericEdit'taskforces.Tab_TaskForcesRules.IARulesStartResources'

     Begin Object Class=moNumericEdit Name=IARulesBuildLimit
         MaxValue=999999
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Control Capacity"
         OnCreateComponent=IARulesBuildLimit.InternalOnCreateComponent
         Hint="The max. amount of structures (measured in buildcosts)."
         WinTop=0.597654
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(17)=moNumericEdit'taskforces.Tab_TaskForcesRules.IARulesBuildLimit'

     Begin Object Class=moCheckBox Name=IARulesBuildAreas
         ComponentJustification=TXTA_Left
         CaptionWidth=0.925000
         Caption="Build Areas"
         OnCreateComponent=IARulesBuildAreas.InternalOnCreateComponent
         Hint="When selected, you can build nearby Outposts and BaseCores only."
         WinTop=0.428125
         WinLeft=0.050000
         WinWidth=0.390626
         WinHeight=0.040000
         OnChange=Tab_TaskForcesRules.BrightOnchange
     End Object
     Controls(18)=moCheckBox'taskforces.Tab_TaskForcesRules.IARulesBuildAreas'

     Begin Object Class=moNumericEdit Name=IARulesMinimumIncome
         MaxValue=250
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Minimum Income"
         OnCreateComponent=IARulesMinimumIncome.InternalOnCreateComponent
         Hint="The BaseCore produces this amount of Energy per minute."
         WinTop=0.428124
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(19)=moNumericEdit'taskforces.Tab_TaskForcesRules.IARulesMinimumIncome'

     Begin Object Class=moNumericEdit Name=IARulesSkillAmount
         MaxValue=999999
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Skill Amount"
         OnCreateComponent=IARulesSkillAmount.InternalOnCreateComponent
         Hint="You will gain this much Skill Points for killing an enemy."
         WinTop=0.428124
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(20)=moNumericEdit'taskforces.Tab_TaskForcesRules.IARulesSkillAmount'

     Begin Object Class=moCheckBox Name=IARulesToggleWarhead
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Enable Warheads"
         OnCreateComponent=IARulesSkillAmount.InternalOnCreateComponent
         Hint="Allows you to turn Warheads on or off."
         WinTop=0.428124
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(21)=moCheckBox'taskforces.Tab_TaskForcesRules.IARulesToggleWarhead'

     Begin Object Class=moCheckBox Name=IARulesFastBuildTime
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Enable Fast Building"
         OnCreateComponent=IARulesFastBuildTime.InternalOnCreateComponent
         Hint="Increases building speed for testing purposes."
         WinTop=0.428124
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(22)=moCheckBox'taskforces.Tab_TaskForcesRules.IARulesFastBuildTime'

     Begin Object Class=moCheckBox Name=IARulesTerr
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Territories"
         OnCreateComponent=IARulesTerr.InternalOnCreateComponent
         Hint="When activated, construction is not allowed in enemy territories, structures may still be placed inside your own territory or in no mans land."
         WinTop=0.428124
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(23)=moCheckBox'taskforces.Tab_TaskForcesRules.IARulesTerr'

     Begin Object Class=moNumericEdit Name=IARulesMaxSentinel
         MaxValue=20
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Max Sentinels"
         OnCreateComponent=IARulesMaxSentinel.InternalOnCreateComponent
         Hint="Set the maximum number of deployer Sentinels per person. Leave at 0 for unlimited."
         WinTop=0.428124
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(24)=moNumericEdit'taskforces.Tab_TaskForcesRules.IARulesMaxSentinel'

     Begin Object Class=moCheckBox Name=IARulesAllowUpgrades
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Allow Upgrades"
         OnCreateComponent=IARulesAllowUpgrades.InternalOnCreateComponent
         Hint="Allows you to turn Sentinel Upgrades on or off."
         WinTop=0.428124
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(25)=moCheckBox'taskforces.Tab_TaskForcesRules.IARulesAllowUpgrades'

     Begin Object class=moCheckBox Name=IARulesUnlimitedRES
         ComponentJustification=TXTA_Left
         CaptionWidth=0.700000
         Caption="Enable Unlimited Resources"
         OnCreateComponent=IARulesUnlimitedRES.InternalOnCreateComponent
         Hint="Provides Infinite Resources for testing purposes."
         WinTop=0.428124
         WinLeft=0.553906
         WinWidth=0.400000
         WinHeight=0.040000
     End Object
     Controls(26)=moCheckBox'taskforces.Tab_TaskForcesRules.IARulesUnlimitedRES'

}
